package com.dm.cloud.auth.feign.service;

import com.dm.cloud.auth.common.dto.AuthDwDTO;
import com.dm.cloud.auth.common.request.AuthDwPageSearch;
import com.dm.cloud.auth.feign.service.impl.AuthDwFeignImpl;
import com.dm.cloud.core.config.CustomFeignRequestInterceptor;
import com.dm.cloud.core.mode.PageList;
import com.dm.cloud.core.mode.ResultModel;
import com.dm.cloud.core.mode.SearchRequestPage;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "equip-auth-service",
        path = "/equip-auth-service/apis/v1/authDw",
        fallback = AuthDwFeignImpl.class,
        configuration = CustomFeignRequestInterceptor.class
)// 这个留着可以继续用feign
public interface AuthDwFeign {

    @PostMapping("/pageList")
    @Operation(summary = "分页查询数据")
    public ResultModel<PageList<AuthDwDTO>> pageList(@RequestBody SearchRequestPage<AuthDwPageSearch> param) ;
    @GetMapping("/{id}")
    @Operation(summary = "查询单条数据详情")
    public ResultModel<AuthDwDTO> detail(@PathVariable("id") String id);
    @PostMapping
    @Operation(summary = "插入一条数据")
    public ResultModel insert(@Validated @RequestBody AuthDwDTO dto);
    @PutMapping
    @Operation(summary = "更新一条数据")
    public ResultModel update(@Validated @RequestBody AuthDwDTO dto);
    @DeleteMapping("/{id}")
    @Operation(summary = "删除一条数据")
    public ResultModel deleteById(@PathVariable("id") String id);
    @PostMapping("/delete/batch")
    @Operation(summary = "批量删除数据")
    public ResultModel<Integer> deleteBatchIds(@RequestBody List<String> ids);
    @PostMapping("/idsList")
    @Operation(summary = "根据ID批量查询数据")
    public ResultModel<List<AuthDwDTO>> idsList(@RequestBody List<String> ids);
}
